package com.sky.controller.user;

import com.sky.pojo.AddressBook;
import com.sky.result.Result;
import com.sky.service.user.UserOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.Address;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
@RequestMapping("/user/order")
@Slf4j
@Api(tags = "订单相关接口")
@RequiredArgsConstructor
public class UserOrderController {
    private final UserOrderService userOrderService;

    @GetMapping("/getEstimatedDeliveryTime")
    @ApiOperation("订单预计送达时间")
    public Result getEstimatedDeliveryTime(Long shopId,String customerAddress){
        LocalDateTime time = userOrderService.getEstimatedDeliveryTime(shopId,customerAddress);
        return Result.success(time.toString());
    }
}
